<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('chapters', function (Blueprint $table) {
            $table->id();
            $table->tinyInteger('book_id')->default(0)->comment('书籍ID');
            $table->string('chapter_title')->comment('章节标题');
            $table->text('chapter_content')->comment('章节内容');
            $table->tinyInteger('chapter_status')->default(0)->comment('章节状态');
            $table->string('chapter_link')->default('')->comment('章节链接');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('chapters');
    }
};
